<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>试卷答题</title>
		<link rel="shortcut icon" href="img/logo.png" />
		<link rel="stylesheet" href="layui/css/layui%20-%20副本.css" media="all">
		<style type="text/css">
			/* 	.a1{
		background-color: antiquewhite;
		width: 100%;
		height: 7%;
		position:fixed; z-index:100; top:0;
		margin-left:-10px;
		
	}
	.a11{
		float: ;
		width: 5%;
		height: 4%;
		background-color: aqua;
		 z-index:999;
	} */
			/* 导航栏 */
			.div1 {
				width: 100%;
				height: 2rem;
				background: #FFF6F6;
				float: left;
				position: fixed;
				top: 0;
				margin-left: -0.625rem;
			}

			/* 导航栏里面的小方框 */
			.div2 {
				width: 1.5rem;
				height: 1.5rem;
				background: #F4F4F5;
				position: fixed;
				top: 0.5%;
				border-radius: 7px;
			}

			/* 导航栏右边时间 */
			.div22 {
				position: absolute;
				margin-top: 5px;
				margin-left: 92%;
			}

			/* 试卷名字 */

			.div3 {
				text-align: center;
			}

			/* 单选题框 */
			.div4 {
				background-color: #FFffff;
				width: 80%;
				height: auto;
				margin-left: 10rem;
				box-shadow: 0 0 10px #EBEEF5;

			}

			/* 多选题框 */
			.div5 {
				background-color: #FFffff;
				width: 80%;
				height: auto;
				margin-left: 10rem;
				box-shadow: 0 0 10px #EBEEF5;
			}
			.div6{
				
				background-color: #FFffff;
				width: 80%;
				height: auto;
				margin-left: 10rem;
				box-shadow: 0 0 10px #EBEEF5;
			}

			#a {
				margin-left: 44%;
			}

			#a1 {
				margin-left: 30%;
			}

			#aa {
				margin-left: 3rem;
			}

			/* 多选题题目 */
			#aaa {
				margin-top: 10px;
				margin-left: 10rem;
			}

			/* 单选题题目 */
			#aaaa {
				margin-left: 10rem;
			}
			/* 简单题的输入框 */
			.t_area{
			width:300px;
			overflow-y:visible
			}
			
			
		</style>
		<script>
		function insert() {
		            $("#guo").append("<img src='qqface/2.gif' />");
		        }
				</script>
	</head>

	<body>
		<!-- 	<div class="a1"></div>
		<div class="a11"></div> -->
		<div class="div1"></div>

		<div class="div22">
			<h7>剩余时间:&nbsp;&nbsp;</h7>
			<h7 id="shijian"></h7>
		</div>

		<!-- <div class="div2">
			<h7 id="a1">1</h7>
		</div> --><br /> <br /> <br />

		<div class="div3">
			<h1>智能训练试卷-1753</h1>


		</div>
		<h7 id="a">试卷得分: </h7>
		<h7 id="aa">试卷耗时: </h7>
		<h3 id="aaa">单选题</h3>
		
		<form action="" method="get">
			<div class="div4">
				<br />

				<table id="table">

				</table>


			</div>
		<h3 id="aaaa">多选题</h3>
					<div class="div5">
						<br />
						<table id="table1">
		
						</table>
					</div>
		
		
					<div class="div6">
						<br />
						<table id="table3">
						<!-- 	<h4 style="margin-left: 1.6rem;">1.</h4>
							<h4 style="margin-left: 3rem; margin-top: -1.1rem;">题目</h4>
						<textarea class="t_area" style="width: 100%;"></textarea> -->
					
					</table>
					</div>
		
		
		<script src="jquery/jquery-1.11.3.min.js"></script>
		<script>
			//获取上个页面拼接的参数
			var path =  window.location.search;
			//数组获取等号右边数
			var array = path.split("&");
			var ids = {};
			for (var i = 0; i < array.length; i++) {
				ids[i] = array[i].split("=")[1]
				console.log(array[i].split("=")[1])
			}
			
			// let a= data[i].spAnswerTime=timestampToTime(data[i].spAnswerTime);
			//
					$.ajax({
						url: "http://localhost:8081/typePaper/answerTime?spId=1",
						type: 'post',
						dataType: "json",
						async: false,
						success: function(data) {
							$('#shijian').html('');
							for (var i = 0; i < data.length; i++) {
								
							 let sj=data[i].spAnswerTime;
							let sjj= setInterval("showtime()",1000);		 
								$('#shijian').append('<h7 id="shijian">'+sj+'</h7>')
								
							}		
						}
					})
					var a;
					//获取单选题
					$.ajax({
						url: "http://localhost:8081/typePaper/PaperFindById?typeId=1",
			
						type: 'post',
						dataType: "json",
						async: false,
						success: function(data) {
							$('#table').html('');
							// for(var i = 0;i<data.length;i++){
							// 	$('#table').append('<label style="margin-left: 1.6rem;">'+data[i].qbId+'<lable>'+'<label>&nbsp; &nbsp;&nbsp;&nbsp;'
							// 	+data[i].qbName+
							// 	'</label > <br />'+'<br /><label style="margin-left: 3rem;"><input type="radio" name="value" value="NO"> '
							// 	+data[i].qbOptions+
							// 	'</label> <br><br>')
							// }
							for (var i = 0; i < data.length; i++) {
								// 给data[i].qbOptions调用split(",")方法 让data[i].qbOptions里面的数据通过,分割 返回一个作用域 ss
								let ss = data[i].qbOptions.split(",");
								// 创建一个空的 str容器
								let str = "";
								// 遍历ss
									str += '解析:&nbsp;<span>'+ data[i].qbParsing + '</span> ' +'</br>' +'</br>'
									str += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;正确答案:&nbsp;<span>'+ data[i].qbAnswer + '</span> ' 
								// console.log(str);
								//定义一个ying  把需要的数据拼接过来 (data[i].qbId)
								let ying = '<label style="margin-left: 1.6rem;">' + data[i].qbId + '<lable>' +
									'<label>&nbsp; &nbsp;&nbsp;&nbsp;' +
									data[i].qbName +
									'</label > <br />' + '<br /><label style="margin-left: 3rem;">' +
									str +
									'</label> <br><br>'
								//把数据拼接给页面0
								$('#table').append(ying)
								// $('#table').append('<label style="margin-left: 1.6rem;">'+data[i].qbId+'<lable>'+'<label>&nbsp; &nbsp;&nbsp;&nbsp;'
								// +data[i].qbName+
								// '</label > <br />'+'<br /><label style="margin-left: 3rem;"><input type="radio" name="value" value="NO"> '
								// +data[i].qbOptions+
								// '</label> <br><br>')
								// 
							}
						}
					})
					//多选题
					$.ajax({
						url: "http://localhost:8081/typePaper/PaperFindById?typeId=2",
			
						type: 'post',
						dataType: "json",
						async: false,
						success: function(data1) {
							$('#table1').html('');
			
							for (var i = 0; i < data1.length; i++) {
								// 给data[i].qbOptions调用split(",")方法 让data[i].qbOptions里面的数据通过,分割 返回一个作用域 ss
								let sss = data1[i].qbOptions.split(",");
								// console.log(ss);
								// 创建一个空的 str容器
								qbid = data1[i].qbId;
								let str = "";
								str += '解析:&nbsp;<span>'+ data1[i].qbParsing + '</span> '+'</br>' +'</br>'
								str += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;正确答案:&nbsp;<span>'+ data1[i].qbAnswer + '</span> ' 
								
								let ying ='<label id="qbId" style="margin-left: 1.6rem;">' + data1[i].qbId + '<lable>' + '&nbsp; &nbsp;' +
								 	data1[i].qbName +
								 	'<br /><br />' +
								 	'<label id="qbId1" style="margin-left: 3rem;" >' +
								 	str +
								 	'</label> <br><br>'
								$('#table1').append(ying)
								
								// $('#table1').append('<label style="margin-left: 1.6rem;">' + data1[i].qbId + '<lable>' + '&nbsp; &nbsp;' +
								// 	data1[i].qbName +
								// 	'<br /><br />' +
								// 	'<label style="margin-left: 3rem;" ><input name="Fruit" type="checkbox" value="" />' +
								// 	data1[i].qbOptions +
								// 	'</label> <br><br>')
							}
						}
					})
					
			
		</script>
	</body>
</html>
